<div class="content-section introduction " >
  <div>
    <span class="feature-title">报表报告 | <small>查看报表</small> </span>
  </div>
</div>

<div class="content-section implementation GridDemo">

  <p-dataTable [value]="reports" [responsive]="true"  >
    <!--<p-column [style]="{'width':'30px'}" selectionMode="multiple" ></p-column>-->
    <!--<p-column field="color" header="序号" [sortable]="true">-->
    <p-column field="name" header="名称" [sortable]="true"></p-column>
    <p-column field="type" header="周期类型" [sortable]="true">
      <ng-template let-col let-car="rowData" pTemplate="body">
        {{car[col.field] == "day" ? "日报" : (car[col.field] == "week" ? "周报" : (car[col.field] == "month" ? "月报" : car[col.field] == "year" ? "年报" : car[col.field]))}}
      </ng-template>
    </p-column>
    <p-column field="way" header="生产方式" [sortable]="true">
      <ng-template let-col let-car="rowData" pTemplate="body">
        {{car[col.field] == "auto" ? "自动" : (car[col.field] == "manual" ? "手动" : car[col.field])}}
      </ng-template>
    </p-column>
    <p-column field="sheet" header="所属模块" [sortable]="true">
      <ng-template let-col let-car="rowData" pTemplate="body">
        {{car[col.field] == "Monitor" ? "温湿度模板" : (car[col.field] == "Fault" ? "报障模板" : (car[col.field] == "Inspection" ? "巡检模板" : (car[col.field]== "Asset" ? "资产模板" : (car[col.field] == "Efficiency" ? "能效模板" : (car[col.field] == "Capacity" ? "容量模板" : car[col.field])))))}}
      </ng-template>
    </p-column>
    <p-column field="time" header="创建时间" [sortable]="true"></p-column>
    <p-column field="" header="操作" [style]="{'width':'12vw'}">
      <ng-template let-report="rowData" pTemplate="operator">
        <button pButton type="button"  (click)="showReportBuild(report)" label="查看" *ngIf="report.way == 'manual'"></button>
        <button pButton type="button"  (click)="uploadReport(report)" label="下载" *ngIf="report.way == 'auto'"></button>
      </ng-template>
    </p-column>
    <ng-template pTemplate="emptymessage">
      当前没有数据
    </ng-template>
  </p-dataTable>
  <p-paginator rows="10" totalRecords="{{total}}" [rowsPerPageOptions]="[10,20,30]" pageLinkSize="{{page_total}}"  (onPageChange)="paginate($event)"></p-paginator>
  <!--<p-growl [(value)]="msgs"></p-growl>-->
  <!--<p-growl [(value)]="deletemsgs"></p-growl>-->

  <p-growl [(value)]="msgPop"></p-growl>
</div>

<!-- 报表生成弹框 -->
<app-report-build [currentRep]="selectRep" (reportBuild)="reportBuild($event)" (closeReportBuild)="closeReportBuild($event)" *ngIf="reportBuildMask"></app-report-build>
<!--<app-templet-edit [currentTem]="selectedCol" [state]="temState" (closeTempletEdit)="closeTempletEdit($event)" (addTem)="addTemNode($event)" (updateTem)="updateTemNode($event)"  *ngIf="showTempletEditMask"></app-templet-edit>-->



